Description of estimation files for "Sequentiality versus Simultaneity: Interrelated Factor Demand",
by Asphjell, Letterie, Nilsen and Pfann. Written on July 18, 2014. 

The estimation results presented in the paper were obtained by running the estimation routine from 
'task.m' for each model specification. The estimations require a maximum of about 10GB of internal 
memory. Because of the need for calculation speed and memory capacity, the estimations were run on a 
computation cluster instead of a regular PC, although the routine should work on any laptop with 
Matlab installed if the size of the state space is reduced. 

To enable execution of the estimation routine written for Matlab (R2012a, 64-bit), this folder should 
contain the following Matlab files:

- task.m: 	Matlab script that initializes parameter search, specifying initial values, 
		search span, size of search grid , moment list and adjustment cost model specification.
		The script saves a workspace that in addition to a vector of parameters that minimizes
		the criterion function, the actual criterion, the variance-covariance matrix and
		corresponding simulation moments.

- annealing.m:	Matlab function that searches for the optimal parameter vector by the an annealing
		cooling algorithm. The function takse arguments corresponding to initial values, 
		search span, grid size, moment selection and adjustment cost model specification.

- simulation.m:	Matlab function that does most of the work in the estimation. For a given set of 
		parameters, the function first finds value and policy function approximations by
		value function iteration. Once completed, the routine continues by taking a random
		draw of shocks, which is combined with the obtained policy functions to generate
		simulated samples.

- evaluation.m	Matlab function that evaluates the fit of a parameter vector by calculating the 
		'weighted distance' between simulation moments and empirical moments.

- sterrors.m:	Matlab function that estimates a variance-covariance matrix for the after parameter
		estimates have been obtained. The Hessian is approximated by calculating a set of 
		numerical derivatives.

- getmoments.m 	Matlab script to obtain moment vector from empirical data. Included in folder to list
		moment descriptions with vector element numbers.

- ndlinspace.m	Matlab function to create generalized linearly spaced matrix for multiple points.

- tauchen.m	Matlab function that discretizes an AR(1) process into a Markov chain. Determines 
		the optimal grid and transition matrix. Based on Tauchen (1991).

In addition, the folder must include the empirical moment vector and corresponding variance-covariance
matrix obtained by block bootstrapping on the empirical sample. These are stored in the workspace 
named 'empmom.mat'. Also, initial values are called by 'task.m' from the workspace named 
'workspace.mat'.



